<include file="public@header"/>
<style>
  .table img {
    width: 50px;
  }

  .layui-tab.back {
    margin-bottom: 10px;
  }

  .back a {
    color: #969696;
  }

  .cinfo {
    display: -webkit-flex; /* Safari */
    display: flex;
  }

  .cinfo_l {
    display: -webkit-flex; /* Safari */
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 20px;
    width: 200px;
    height: 130px;
  }

  .cinfo_l img {
    max-width: 100%;
    max-height: 100%;
  }

  .cinfo_r {
    flex: 1;
    display: -webkit-flex; /* Safari */
    display: flex;

    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;

  }

  .cinfo_name {
    flex: 1;
    color: #323232;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
  }

  .detail td{
    border-width: 0;
  }

  .trade_item_list{
    display: -webkit-flex; /* Safari */
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .trade_item_list .trade_item{
    flex: 1;
  }
  .trade_item_v{
    font-size: 16px;
    font-weight: bold;
  }
  .js_tips{
    margin-left: 10px;
  }
</style>
</head>
<body>
<div class="layui-fluid">
  <div class="layui-row">

    <div class="layui-page-content">
      <div class="layui-card">
        <div class="layui-card-body">
          <div class="layui-tab layui-tab-brief back">
            <if condition="$data.o_top_type_id == 1">
              <a href="{:url('merchant.cate/index')}">返回</a>
              <elseif condition="$data.o_top_type_id == 3">
                <a href="{:url('merchant.serve/index')}">返回</a>
                <elseif condition="$data.o_top_type_id == 4">
                  <a href="{:url('merchant.look_shop/index')}">返回</a>
                  <elseif condition="in_array($data.o_top_type_id,[5,6,7,8])">
                    <a href="{:url('merchant.supermarket/index')}">返回</a>
                    <else/>
            </if>
          </div>
          <div class="cinfo">
            <div class="cinfo_l">
              <img src="{$data['thumb']}">
            </div>
            <div class="cinfo_r">
              <div class="cinfo_name">{$data['name']}</div>
              <div class="cinfo_btn">
                <a class="layui-btn layui-btn-sm"  href="javascript:admin.openIframeLayer('{:url('merchant.cate/ReadIndustry',array('id'=>$data['id']))}','资质',{area:['60%', '600px'],end:function(){}})">资质</a>
              </div>
            </div>

            <table class="layui-table table-hover table-bordered table-list detail" lay-even="" lay-size="lg">
              <tbody>
              <tr style="border-width: 0;">
    
                <td>
                  <span style="font-weight: 600;">类型: </span>
                  {$data['store_type']['name'] ?? '--'}
                </td>
                <td>
                  <span style="font-weight: 600;">总评: </span>
                  {$data['remark'] ?? '--'}
                </td>
              </tr>
              <tr>
    
                <td>
                  <span style="font-weight: 600;">口味|包装|配送满意度:</span>
                  {$taste_star}|{$packaging_star}|{$distribution_star}
                </td>
                <td>
                  <span style="font-weight: 600;">营业时间: </span>
                  {$businessHours}</td>
              </tr>
              <tr>
                <td>
                  <span style="font-weight: 600;">地址: </span>
                  {$data['address']}
                </td>
              </tr>
              </tbody>
            </table>

          </div>
        </div>
      </div>
    </div>

    <div class="layui-page-content">

      <div class="layui-card">
        <div class="layui-tab layui-tab-brief">
          <ul class="layui-tab-title">
            <li><a href="{:url("merchant.cate/read",["type"=>"now",'id'=>$data['id']])}">当前订单</a></li>
            <li><a href="{:url("merchant.cate/read",["type"=>"before",'id'=>$data['id']])}">过往订单</a></li>
            <li><a class="layui-this" href='{:url("merchant.cate/evaluateIndex",['id'=>$data['id']])}'>评价列表</a></li>
            <li><a href='{:url("merchant.cate/product",['id'=>$data['id']])}'>商品列表</a></li>
            <li><a href='{:url("merchant.cate/storeType",['id'=>$data['id']])}'>店铺分类</a></li>
          </ul>
        </div>

        <div class="layui-card">
          <div class="layui-card-body">
            <form class="layui-form" method="get" action="{:url("merchant.cate/evaluateIndex",['id'=>$data['id']])}">
            <div class="layui-form-item layuiadmin-card-text" style="margin-bottom: 0;">

              <div class="layui-inline">
                <label class="layui-form-label">是否有图</label>
                <div class="layui-input-inline">
                  <select class="form-control layui-input" name="show_img">
                    <option value='0'>全部</option>
                    <option <eq name="show_img" value="1">selected</eq> value='1'>有</option>
                    <option <eq name="show_img" value="2">selected</eq> value='2'>无</option>
                  </select>
                </div>
              </div>
              <div class="layui-inline">
                <label class="layui-form-label">是否有视频</label>
                <div class="layui-input-inline">
                  <select class="form-control layui-input" name="show_video">
                    <option value='0'>全部</option>
                    <option <eq name="show_video" value="1">selected</eq> value='1'>有</option>
                    <option <eq name="show_video" value="2">selected</eq> value='2'>无</option>
                  </select>
                </div>
              </div>

              <div class="layui-inline">
                <label class="layui-form-label">用户ID</label>
                <div class="layui-input-inline">
                  <input type="text" class="layui-input" name="uid" value="{:input('uid')}"
                         autocomplete="off" placeholder="用户ID">
                </div>
              </div>

              <div class="layui-inline">
                <div class="layui-input-inline">
                  <input type="submit" class="layui-btn btn-primary" value="搜索" />
                  <a class="layui-btn layui-btn-danger btn-danger" href="{:url("merchant.cate/evaluateIndex",['id'=>$data['id']])}">清空</a>
                </div>
              </div>
            </div>
            </form>
          </div>
        </div>
          <div class="layui-card-body">
            <div class="layui-row">
              <div class="layui-col-md6">
                <div class="layui-card">
                  <div class="layui-card-header">数据统计</div>
                  <div class="layui-card-body">
                    <div class="trade_item_list">
                      <div class="trade_item">
                        <div class="trade_item_t">
                          订单总评
                          <span class="layui-icon layui-icon-tips js_tips" data-tip="所有订单的评价数，"></span>
                        </div>
                        <div class="trade_item_v">
                          {$all_count}
                        </div>
                      </div>

                      <div class="trade_item">
                        <div class="trade_item_t">
                          有图
                          <span class="layui-icon layui-icon-tips js_tips" data-tip="包括视频评价，"></span>
                        </div>
                        <div class="trade_item_v">
                          {$has_img}
                        </div>
                      </div>

                      <div class="trade_item">
                        <div class="trade_item_t">
                          好评
                          <span class="layui-icon layui-icon-tips js_tips" data-tip="订单的五星数量，"></span>
                        </div>
                        <div class="trade_item_v">
                          {$good}
                        </div>
                      </div>

                      <div class="trade_item">
                        <div class="trade_item_t">
                          差评
                          <span class="layui-icon layui-icon-tips js_tips" data-tip="订单的一星数量，"></span>
                        </div>
                        <div class="trade_item_v">
                          {$bad}
                        </div>
                      </div>

                    </div>
                  </div>
                </div>
              </div>
            </div>

          </div>
        </div>

        <div class="layui-card-body">
          <form method="post" class="js-ajax-form" method="post">
            <table class="layui-table table-hover table-bordered table-list" id="menus-table" lay-even=""
                   lay-size="lg">
              <thead>
              <tr>
                <th width="80">ID</th>
                <th>用户</th>
                <th>总体|口味|包装</th>
                <if condition="in_array($data.o_top_type_id,[1])">
                  <th>赞|踩商品</th>
                </if>
                <if condition="in_array($data.o_top_type_id,[1])">
                  <th>骑手评分</th>
                </if>
                <th>商品数量</th>
                <th>内容</th>
                <th>评价点赞</th>
                <th>商家回复</th>
                <th>回复时间时间</th>
                <th>是否展示</th>
                <th>评论图片</th>
                <th>评价时间</th>
                <th align="center">{:lang('ACTIONS')}</th>
              </tr>
              </thead>
              <tbody>
              <volist name="list" id="vo">
                <tr>
                  <td>
                    {$vo['id']}
                  </td>
                  <td>{$vo['userinfo']['user_nickname'] ?? '--'}({$vo['uid']})</td>
                  <td>{$vo['overall_star']}|{$vo['taste_star']}|{$vo['packaging_star']}</td>
                  <if condition="in_array($data.o_top_type_id,[1])">
                    <td>{$vo['tag_praise']}|{$vo['tag_tread']}</td>
                  </if>
                  <if condition="in_array($data.o_top_type_id,[1])">
                    <td>{$vo['evaluate']['star'] ?? '--'}</td>
                  </if>
                  <td>{$vo['store_order']['total_num'] ?? '--'}</td>
                  <td>{$vo['content'] ?? '--'}</td>
                  <td>{$vo['like']}</td>
                  <td>
                    {$vo['merchant_reply_content'] ?: '--'}
                  </td>
                  <td>
                    <if strtotime($vo['merchant_reply_time']) == 0>
                      ---
                      <else/>
                      {$vo['merchant_reply_time'] ?: '--'}
                    </if>
                   
                  </td>
                  <td>
                    {$vo['is_show']}
                  </td>
                  <td>
                    <foreach name="$vo.pics" item="item">
                      <notempty name="item">
                        <a href="javascript:admin.imagePreviewDialog('{$item}');">
                          <i class="icon-icon layui-icon-md-images"></i>
                        </a>
                        <else/>
                        <a><i class="icon-icon layui-icon-md-close"></i></a>
                      </notempty>
                    </foreach>
                  </td>
                  <td>{$vo['addtime']}</td>

                  <td>
                    <if condition="$vo['o_is_show']">
                      <a class="layui-bo layui-bo-checked layui-bo-small js-ajax-delete" data-msg="确定此项操作?" href="{:url('merchant.cate/setShow',array('oid'=>$vo['oid'],'is_show'=>0))}">隐藏</a>
                    <else/>
                      <a class="layui-bo layui-bo-checked layui-bo-small js-ajax-delete" data-msg="确定此项操作?" href="{:url('merchant.cate/setShow',array('oid'=>$vo['oid'],'is_show'=>1))}">展示</a>
                    </if>
                    <a class="layui-bo layui-bo-checked layui-bo-small" href="javascript:admin.openIframeLayer('{:url('merchant.cate/productReply',array('store_oid'=>$vo['oid'],'store_id'=>$vo['store_id']))}','赞踩商品',{area:['60%', '600px'],end:function(){}})">赞踩商品</a>
                    <if condition="$vo['video']">
                      <a class="layui-bo layui-bo-checked layui-bo-small" href="javascript:admin.openIframeLayer('{:url('merchant.cate/replyVideo',array('id'=>$vo['id']))}','评价视频',{area:['60%', '600px'],end:function(){}})">评价视频</a>
                    </if>
                    <a class="layui-bo layui-bo-small layui-bo-close js-ajax-delete" href="{:url('merchant.cate/delete',array('oid'=>$vo['oid']))}">{:lang('DELETE')}</a>
                  </td>
                </tr>
              </volist>
              </tbody>
            </table>
            <div class="pagination">{$page}</div>
          </form>
        </div>

      </div>
    </div>

  </div>

</div>
<include file="public@script"/>
<script>
  (function (){
    $('.js_tips').mouseover(function (){
      let _that=$(this);
      let tip=_that.data('tip');
      layer.tips(tip, _that);
    })
  })()
</script>
</body>
</html>